package create_创建型.abstract_factory_pattern_抽象工厂模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/03/14:51
 * @Description:
 */
public class ShapeFactory extends AbstractFactory {

	public Color getColor(String color) {
		return null;
	}

	public Shape getShape(String color) {
		if (color != null) {
			if (color.equalsIgnoreCase("circle")) {
				return new Circle();
			}
			if (color.equalsIgnoreCase("square")) {
				return new Square();
			}
			if (color.equalsIgnoreCase("rectangle")) {
				return new Rectangle();
			}
		}
		return null;
	}
}
